Crate puffin[−][src]
Expand description
Usage:
fn main() { puffin::set_scopes_on(true); // you may want to control this with a flag // game loop loop { puffin::GlobalProfiler::lock().new_frame(); { puffin::profile_scope!("slow_code"); slow_code(); } } }
Macros
current_file_name | Returns a shortened path to the current file. |
current_function_name | Returns the name of the calling function without a long module path prefix. |
profile_function | Automatically name the profiling scope based on function name. |
profile_function_data | Deprecated |
profile_scope | Profile the current scope with the given name (unique in the parent scope). |
profile_scope_data | Deprecated |
Structs
FrameData | One frame worth of profile data, collected from many sources. |
GlobalProfiler | Singleton. Collects profiling data from multiple threads. |
MergePiece | |
MergeScope | An record of several sibling (or cousin) scopes. |
ProfilerScope | Created by the |
Reader | Parses a |
Record | Used when parsing a Stream. |
Scope | Used when parsing a Stream. |
Stream | Stream of profiling events from one thread. |
ThreadInfo | Used to identify one source of profiling data. |
ThreadProfiler | Collects profiling data for one thread |
Enums
Error | Errors that can happen when parsing a |
Functions
are_scopes_on | Are the profiler scope macros turned on?
This is |
global_reporter | Report a stream of profile data from a thread to the |
merge_children_of_pieces | Merge sibling scopes with the same id. |
merge_top_scopes | Merge sibling scopes with the same id. |
now_ns | Returns monotonically increasing nanosecond count.
It is undefined when |
set_scopes_on | Turn on/off the profiler macros ( |
Type Definitions
FrameIndex | |
NanoSecond | All times are expressed as integer nanoseconds since some event. |
Result |